package com.ourhealth.mapper;

import com.ourhealth.pojo.OrderSetting;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderSettingMapper {
    /**
     * 新建或修改预约人数上限
     * @param date
     * @return
     */
    int isHandleOrderSet(@Param("date") Date date);

    /**
     * 更新预约人数上限
     * @param orderSetting
     */
    void updateHandleOrderSet(@Param("orderSetting") OrderSetting orderSetting);

    /**
     * 添加预约人数上限
     * @param orderSetting
     */
    void addHandleOrderSet(@Param("orderSetting") OrderSetting orderSetting);

    /**
     * 通过月份获取预约详情
     * @return
     */
    List<OrderSetting> getOrderSetting(@Param("map") Map map);

    /**
     * 通过日期获取预约详情
     * @param orderDate
     * @return
     */
    Integer getOrderSettingByDay(@Param("orderDate") String orderDate);

    /**
     * 预约人数+1
     * @param orderDate
     * @param version
     * @return
     */
    int editReservations(@Param("orderDate") String orderDate, @Param("version") int version);

    /**
     * @param orderDate
     * @return
     */
    int getVersionByDate(@Param("orderDate") String orderDate);
}
